home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 20
/
Aminet 20 (1997)(GTI - Schatztruhe)[!][Aug 1997].iso
/
Aminet
/
comm
/
www
/
CountryCodes.lha
/
countrycodes
/
awebextractsuffix.rexx
next >
Wrap
OS/2 REXX Batch file
|
1997-06-22
|
2KB
|
60 lines
/*
Program: AWebExtractSuffix.rexx
Purpose: Extract suffix from a www address obtained from Aweb and feed it
to the CountryCodes program.
Author : Paul Kolenbrander (paul@serena.iaehv.nl)
Version: 1.0
Reqs : CountryCode 1.0 or higher and RexxMast must be running.
*/
OPTIONS RESULTS /* enable return codes */
/* Get AWeb's Arexx Port */
ports = SHOW('P')
PARSE VAR ports dummy 'AWEB.' portnr . /* note trailing period! */
ADDRESS VALUE 'AWEB.' || portnr
'GET ACTIVEPORT'
ADDRESS VALUE RESULT
GET URL
MAILADRES = RESULT
ports = SHOW('P') /* Get CoCo ARexx port */
PARSE VAR ports dummy 'COCO' portnr . /* note trailing period! */
ADDRESS VALUE 'COCO' || portnr
/* Optionally bring CountryCodes Window to front and activate it */
WINDOW FRONT
WINDOW ACTIVATE
/* Check if it's a http:// (www) address) */
IF (UPPER(LEFT(MAILADRES,7)) == "HTTP://")
THEN DO /* found a WWW address */
MAILADRES = RIGHT(MAILADRES, LENGTH(MAILADRES) - 7)
MAILADRES = LEFT(MAILADRES, POS("/",MAILADRES) - 1)
LOCATE RIGHT(MAILADRES, LENGTH(MAILADRES) - LASTPOS(".",MAILADRES))
END
/* Check if it's a file:// (local address) */
IF (UPPER(LEFT(MAILADRES,7)) == "FILE://")
THEN DO /* found a WWW address */
LOCATE XXXXX /* Local adres. No suffix */
END
/* Check if it's suffix.domain!user or user@domain.suffix format */
IF (POS("!",MAILADRES) ~=0)
THEN DO /* ! (bangpath) address */
MAILADRES = LEFT(MAILADRES,POS("!",MAILADRES) - 1)
LOCATE RIGHT(MAILADRES, LENGTH(MAILADRES) - LASTPOS(".",MAILADRES))
END
IF (POS("@",MAILADRES) ~=0)
THEN DO /* @ type address */
LOCATE RIGHT(MAILADRES, LENGTH(MAILADRES) - LASTPOS(".",MAILADRES))
END
/* Now wait 5 seconds and push the CountryCodes window back */
ADDRESS COMMAND 'C:WAIT 5 secs'
WINDOW BACK
EXIT